package com.test.clyq.entity;

import java.util.Set;

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import com.test.entity.Item;
import com.test.json.JsonUtil;

/**
 * 栏目. <br>
 * 栏目实体.
 * <p>
 * Copyright: Copyright (c) 2010-4-13 下午02:58:15
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: liuxl@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */
public class Category implements Item {

	private static final long serialVersionUID = 1186047164533L;

	/** 栏目描述 */
	private String categoryDesc;

	/** 首页位置 */
	private String categoryHomePageUrl;

	/** 栏目标识ID */
	private Long categoryId;

	/** 栏目图片URL */
	private String categoryImageUrl;

	/** 栏目域图片 */
	private Set<CategoryImg> categoryImgSet;

	/** 栏目图片转到的地址 */
	private String categoryImgToUrl;

	/** 栏目级别 */
	private Long categoryLevel;

	/** 栏目名称 */
	private String categoryName;

	/** 栏目父标识ID */
	private Long categoryParentId;

	/** 数据权限 */
	private Set<DataPermission> dataPermissionSet;

	/** 栏目文章 */
	private Set<EntityItem> entityItemSet;

	/** 是否定制时对用户可见 0:不可见,1:可见 */
	private Integer isPublic = 1;

	/** 是否推荐 0否 1是 */
	private Integer isPush = 0;

	/** 置顶 0否 1是 */
	private Integer isTop = 0;

	/** 顺序 */
	private Integer location = 0;

	/** 彩信上栏目顺序 */
	private Integer mmsLocation = 0;

	/** 所属网站标识 */
	private Integer website;

	/** 是否是专题栏目 0:不是,1:是 */
	private Integer zhuanTi;

	/** 模板类型 1：多图片滑动块 2：单标题摘要块 3：文章标题列表 4：文章图片标题描述列表 */
	private Integer templateType;

	public Integer getZhuanTi() {
		return zhuanTi;
	}

	public void setZhuanTi(Integer zhuanTi) {
		this.zhuanTi = zhuanTi;
	}

	public Integer getTemplateType() {
		return templateType;
	}

	public void setTemplateType(Integer templateType) {
		this.templateType = templateType;
	}

	public String getCategoryDesc() {
		return this.categoryDesc;
	}

	public String getCategoryHomePageUrl() {
		return categoryHomePageUrl;
	}

	public Long getCategoryId() {
		return categoryId;
	}

	public String getCategoryImageUrl() {
		return this.categoryImageUrl;
	}

	public Set<CategoryImg> getCategoryImgSet() {
		return categoryImgSet;
	}

	public String getCategoryImgToUrl() {
		return categoryImgToUrl;
	}

	public Long getCategoryLevel() {
		return this.categoryLevel;
	}

	public String getCategoryName() {
		return this.categoryName;
	}

	public Long getCategoryParentId() {
		return this.categoryParentId;
	}

	public Set<DataPermission> getDataPermissionSet() {
		return dataPermissionSet;
	}

	public Set<EntityItem> getEntityItemSet() {
		return entityItemSet;
	}

	public Long getId() {
		return this.categoryId;
	}

	public Integer getIsPublic() {
		return this.isPublic;
	}

	public Integer getIsPush() {
		return this.isPush;
	}

	public Integer getIsTop() {
		return isTop;
	}

	public Integer getLocation() {
		return this.location;
	}

	public Integer getMmsLocation() {
		return mmsLocation;
	}

	public Integer getWebsite() {
		return website;
	}

	public void setCategoryDesc(String categoryDesc) {
		this.categoryDesc = categoryDesc;
	}

	public void setCategoryHomePageUrl(String categoryHomePageUrl) {
		this.categoryHomePageUrl = categoryHomePageUrl;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	public void setCategoryImageUrl(String categoryImageUrl) {
		this.categoryImageUrl = categoryImageUrl;
	}

	public void setCategoryImgSet(Set<CategoryImg> categoryImgSet) {
		this.categoryImgSet = categoryImgSet;
	}

	public void setCategoryImgToUrl(String categoryImgToUrl) {
		this.categoryImgToUrl = categoryImgToUrl;
	}

	public void setCategoryLevel(Long categoryLevel) {
		this.categoryLevel = categoryLevel;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public void setCategoryParentId(Long categoryParentId) {
		this.categoryParentId = categoryParentId;
	}

	public void setDataPermissionSet(Set<DataPermission> dataPermissionSet) {
		this.dataPermissionSet = dataPermissionSet;
	}

	public void setEntityItemSet(Set<EntityItem> entityItemSet) {
		this.entityItemSet = entityItemSet;
	}

	public void setId(Long id) {
		this.categoryId = id;
	}

	public void setIsPublic(Integer isPublic) {
		this.isPublic = isPublic;
	}

	public void setIsPush(Integer isPush) {
		this.isPush = isPush;
	}

	public void setIsTop(Integer isTop) {
		this.isTop = isTop;
	}

	public void setLocation(Integer location) {
		this.location = location;
	}

	public void setMmsLocation(Integer mmsLocation) {
		this.mmsLocation = mmsLocation;
	}

	public void setWebsite(Integer website) {
		this.website = website;
	}

	public String toJSON() {
		return JsonUtil.getJsonStringFromObject(this);

	}

	public String toXML() {
		Document doc = DocumentHelper.createDocument();
		Element root = doc.addElement("items");
		root.addElement("i").addAttribute("n", "主键").setText(String.valueOf(this.categoryId == null ? "" : this.categoryId));
		root.addElement("i").addAttribute("n", "栏目名称").setText(String.valueOf(this.categoryName == null ? "" : this.categoryName));
		root.addElement("i").addAttribute("n", "栏目描述").setText(String.valueOf(this.categoryDesc == null ? "" : this.categoryDesc));

		root.addElement("i").addAttribute("n", "栏目级别").setText(String.valueOf(this.categoryLevel == null ? "" : this.categoryLevel));

		root.addElement("i").addAttribute("n", "栏目父标识").setText(String.valueOf(this.categoryParentId == null ? "" : this.categoryParentId));

		return doc.asXML();
	}

}
